package com.rbac.utils.commUtils;


///字符串相关工具类
public class StringPubUtil {




    /**
     * 截取两遍指定的字符
     * @param character
     * @param symbol
     * @return
     */
    public static String trim(String character, String symbol){
        if(character == null || symbol == null  || character.length() == 0 || symbol.length() == 0){
            return character;
        }
        //先截取左边
        character = (character.substring(0,1).equals(symbol)) ? character.substring(1) : character;

        //截取右边
        Integer len = character.length();
        character = len >0 && (character.substring(len-1,len).equals(symbol)) ? character.substring(0,len-1) : character;

        //返回截取后的
        return character;
    }



}
